from typing import Dict, Any
from utils.rag_utils import RAGSystem
from config import INTENT_PROMPT

class RAGAgent:
    def __init__(self):
        self.rag = RAGSystem()
        self.hook_template = "回到引导流程，请问您完成了{}阶段吗？"

    def handle_query(self, question: str, current_stage: str) -> Dict[str, Any]:
        answer, sources = self.rag.query(question)
        return {
            "type": "rag",
            "content": answer,
            "sources": sources,
            "follow_up": self.hook_template.format(current_stage)
        }